#ifndef PRINTWINDOW_H
#define PRINTWINDOW_H

#include <QMainWindow>
#include <QSharedPointer>
#include <QPrinterInfo>
#include <QMutex>
#include <QThread>
#include <QWaitCondition>
#include <mediaitem.h>
#include "engine.h"

namespace Ui {
class PrintWindow;
}

class PrintWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit PrintWindow(PioCore * core, QWidget *parent = 0);
    ~PrintWindow();
    Engine * engine() { return &m_engine; }

protected:
    virtual void showEvent(QShowEvent *);
    virtual void hideEvent(QHideEvent *);

private slots:
    void on_actionZoomOut_triggered();

    void on_actionPrevPage_triggered();

    void on_actionNextPage_triggered();

    void on_actionPageSetup_triggered();

    void on_actionZoomIn_triggered();

    void on_actionRotateImagesToFit_triggered(bool checked);

    void on_actionLandscapeFormat_triggered(bool checked);

    void on_actionCropImages_triggered();

    void on_actionShrinkImages_triggered();

    void on_actionMatchWidth_triggered();

    void on_actionMatchHeight_triggered();

    void on_actionPrintMarkers_triggered(bool checked);

    void on_actionPrint_triggered();

    void on_width_editingFinished();

    void on_height_editingFinished();

    void on_printer_activated(int index);

private:
    double getValue(class QLineEdit * e);

private:
    Ui::PrintWindow *ui;
    class QPrintPreviewWidget * m_preview;
    Engine m_engine;
};

#endif // PRINTWINDOW_H
